import {PluginCommand} from "../PluginCommand";

class PointCloudSimplifyCommand extends PluginCommand{
  constructor() {
    super();
  }

  getElementsByFeatureNames(featureNames, cb){
    if (this.query) {
      this.query.getElementsByFeatureNames(featureNames).then(res => {
        cb(res);
      })
    }
  }

  getFeaturesByNames(featureNames, cb){
    if (this.query) {
      this.query.getFeaturesByNames(featureNames).then(res => {
        cb(res);
      })
    }
  }

  getElementsByIds(elementIds, cb) {
    if (this.query) {
      this.query.getElementsByIds(elementIds).then(res => {
        cb(res);
      });
    }
  }

  //点云简化预览
  previewPointCloudSimplify(cmd, cb){
    if (this.toolQuery) {
      this.toolQuery.executePreviewPointCloudSimplifyCmd({cmd: cmd}).then(res => {
        cb(res);
      });
    }
  }

  //点云简化创建
  createPointCloudSimplify(cmd, cb){
    if (this.toolQuery) {
      this.toolQuery.executeCreatePointCloudSimplifyCmd({cmd: cmd}).then(res => {
        cb(res);
      });
    }
  }

  //点云简化设置显隐
  setPointCloudSimplifyVisible(params, cb){
    if (this.toolQuery) {
      this.toolQuery.setPointCloudSimplifyVisible(params);
    }
  }

  //点云简化清空预览
  clearPreViewPointCloudSimplify(cb){
    if (this.toolQuery) {
      this.toolQuery.clearPreViewPointCloudSimplify();
    }
  }
}

const pointCloudSimplifyCommand = new PointCloudSimplifyCommand();
export {pointCloudSimplifyCommand};
